#include <QObject>

#ifndef FRIEND_H
#define FRIEND_H

class Friend: public QObject
{
    Q_OBJECT

    Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
    Q_PROPERTY(long sid READ sid WRITE setSid NOTIFY sidChanged)
    Q_PROPERTY(int state READ state WRITE setState NOTIFY stateChanged)
    Q_PROPERTY(int host READ host WRITE setHost NOTIFY hostChanged)
public:
    Friend();
    Friend(const Friend &f);
    Friend& operator=(const Friend& f);
    bool operator<(const Friend& right);


    QString f_name;
    qlonglong f_sid;
    int f_state; // 0: offline, 1: online
    int f_host; // 1: is lobby host

    QString name();
    void setName(QString name);
    long sid();
    void setSid(qlonglong sid);
    int state();
    void setState(int state);
    int host();
    void setHost(int host);
signals:
    void nameChanged();
    void sidChanged();
    void stateChanged();
    void hostChanged();
};

#endif // FRIEND_H
